'use strict';
function numToChar(num) {
  let remainder = num%26;
  let quotient = parseInt(num/26);

  if(quotient === 0){
    return String.fromCharCode(remainder+96)
  }

  else if(quotient ===1&&remainder===0){
    return 'z';
  }

  else if(quotient > 1&&remainder===0){
    return numToChar(quotient-1) + 'z';
  }else {
    return numToChar(quotient) + String.fromCharCode(remainder+96);
  }
}

function get_letter_interval(number_a, number_b) {
  let result=[];
 if(number_a>number_b){
   for(let i=number_a;i>=number_b;i--){
     result.push(numToChar(i));
   }
 }
 else if(number_a<number_b){
   for(let i=number_a;i<=number_b;i++){
     result.push(numToChar(i));
   }
 }
 else {
   result.push(numToChar(number_a));
 }
  
 console.log(result);
 return result;
}
get_letter_interval(1,5);
get_letter_interval(5,1);
get_letter_interval(5,5);
module.exports = get_letter_interval;
